package flexo.physic.force;

import flexo.math.Vector;
import flexo.physic.entity.Entity;

public class SimpleForce extends Force
{
	protected Vector direction;
	protected Vector force;

	public SimpleForce(String name, Vector direction)
	{
		super(name);
		this.direction = new Vector();
		this.force = new Vector();
		
		setDirection(direction);
		setMagnitude(0);		
	}
	
	public void setDirection(Vector direction)
	{
		this.direction.set(direction);
		this.direction.normalize();
	}
	
	public void setMagnitude(float value)
	{
		force.set(direction);
		force.scale(value);
	}

	@Override
	public Vector calculateForce(Entity e, float deltaTime)
	{
		return force;
	}
}
